<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
	<head>
		<title>试玩用户</title>
		<%@include file="/WEB-INF/base.jspf"%>
		<script src="/js/font_595888_1jlcfz62jg8vkj4i.js"></script>
		<style>	
		/* 	input,.btn{margin-top: 20px;} */
			.code{width: 110px;height: 38px;border: 0px solid black;position:absolute;right:0;  margin-top: -42px;margin-right: 3px;}
			a{color: black;}
			.content-middle-body > input, .content-middle-body > button, .content-middle-body > a {
				margin-top:12px;
				margin-bottom: 12px;
			}
			  .icon {
			     width: 1em; height: 1em;
			     vertical-align: -0.15em;
			     fill: currentColor;
			     overflow: hidden;
			  }					
			.col-sm-4, .col-xs-12 {
				padding-left:0;
				padding-right:0;
			}
			.div-c-chooseChatWrapper, .div-c-chooseChatWrapper > div {
				display:flex;
				align-items:center;
			}
			.div-c-chooseChatWrapper > div > span {
				margin-left:16px;
			}
			.modal-body .div-c-chooseChatWrapper + .div-c-chooseChatWrapper {
				border-top:1px solid #cecece;
			}
			.div-c-chooseChatWrapper {
				justify-content:space-between;
				padding:2vh;
			}
			.div-c-chooseChatWrapper svg {
				width:6vh;
				height:6vh;
				max-width:40px;
				max-height:40px;
			}	
			p{color:#6084C2;font-size:13px;text-align: left;margin-top: 10px;}		
		</style>
	</head>
	<body style="">
		<div class="bg-theme text-center top clearfix col-xs-12 col-sm-4 col-sm-offset-4">
			<a onclick="back()" class="glyphicon glyphicon-chevron-left" style="color: white;top: 50%;transform:translateY(-50%);left:10px;position: absolute;cursor: pointer;"></a>
			<span>试玩用户</span>
		</div>
		<div class="text-center clearfix content-middle-body scroll col-xs-12 col-sm-4 col-sm-offset-4" style="padding-left:30px;padding-right:30px;margin-top:60px;">
			<!-- 正文开始 -->
			<input id="name" type="text" value="${swzh }" readonly="readonly" class="form-control input-lg" ></input>
			<input id="pass" type="password" placeholder="请输入密码【6~10】" maxlength="10" class="form-control input-lg"></input>
			<span id="notice" style="width:100%;color: red;border: 0;display: block;font-size: 16px;text-align: left;"></span>
			<button id="tryplay" class="btn btn-lg pm bg-theme">免费试玩</button>
			<!-- 正文结束 -->
			<p style="margin-top: 30px;">
				1、每个试玩账号初始金额为2000人民币，不允许充值
			</p>
			<p>
				2、每个IP只允许有3个试玩账号;
			</p>
			<p>
				3、试玩账号只提供玩家熟悉游戏，不允许充值和提现;
			</p>
			<p>
				4、试玩张号不享有参加优惠活动的权利;
			</p>
		</div>
		
		
<div class="modal-div-fakeModal" id="div-i-noticeGenDan">
	<div class="div-c-modalContent">
		<h3 class="fakemodal-title"></h3>
		<div class="fakemodal-content"></div>
		<div class="fakemodal-btnsGroup"><button class="btn btn-default btn-class-closeFakeModal">关闭</button></div>
	</div>
</div>			
	</body>
	<script>
	fixHeadAndFoot()
	 setContentBodyHeight()
	     
		$("#kefuModal").on(getEndClickEvent(), ".div-c-chooseChatWrapper", function(event) {
			var self = event.currentTarget
			var qqNum = self.dataset.qqnum
			if (self.dataset.type == "qq") {
				location.href = "http://wpa.qq.com/msgrd?v=3&uin=" + qqNum + "&site=qq&menu=yes"
			} else {
				location.href = "/chat/kefu.do"
			}
		})	     
		
	     $("#a-i-forgetPassWord").on(getEndClickEvent(), function(e) {
	    	 e.preventDefault()
	    	 $("#kefuModal").modal("show")
	     })
	ajax({
		url: "/cplays.do",
		type: "post",
		data: {},
		success: function(data) {
			var newData = JSON.parse(data)
			if (newData.data == 1) {
				$("#tryplay").addClass("active")
			}
		},
		error: function(status) {
			showNormalNoticeModal("#div-i-noticeGenDan", "提示：", "网络繁忙")
		}
	}) 	    	
    	
		$(function(){
			$("input").bind('input propertychange', function() {
				if(isNull()=="ok"){
					$("#notice").text("");
					$("#login").removeClass("disabled");
				}else{
					$("#notice").text(isNull());
				}
			});
			$(".code").click(function(){
				$(".code").attr("src","/u/code.do?"+Math.random());
			});
			$("#tryplay").click(function(){
				if(isNull()!="ok"){
					showNormalNoticeModal("#div-i-noticeGenDan", "提示：", isNull())
					return;
				}
				ajax({
					url:'/u/checkUser.do',
					data:{name:$("#name").val()},
					type:'post',
					success:function(data){
						var json=eval('('+data+')');
						if(json.data!=0){
							showNormalNoticeModal("#div-i-noticeGenDan", "提示：", "用户名已经存在！")
						}else{
							ajax({
								url:'/u/tryplay.do',
								data:{name:$("#name").val(),pass:$("#pass").val()},
								type:'post',
								success:function(data){
									var json=eval('('+data+')');
									if(json.message==1){
										window.location.href="/sy.do";
									}else{
										showNormalNoticeModal("#div-i-noticeGenDan", "提示：", json.message)
									}
								}
							});
						}
					}
				});
			});
		});
		function isNull(){
			if($("#name").val()==""||$("#name").val()==null) return "用户名不能为空";
			else if($("#pass").val()==""||$("#pass").val()==null) return "密码不能为空";
			else if ($("#pass").val().length<6||$("#pass").val().length>16) return "密码不能小于6位或大于16位";
			else return "ok";
		}
		
		stopUserScaleScreenIOS()
	</script>
</html>
